//
//  YuYueLabelTextField.m
//  FD
//
//  Created by xiaofang wang on 2018/11/8.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//

#import "YuYueLabelTextField.h"

@implementation YuYueLabelTextField

- (instancetype)initWithFrame:(CGRect)frame leftTitle:(NSString *)title placeholder:(NSString *)placeholder
{
    self = [super initWithFrame:frame];
    
    if (self) {
        [self setupViewWithTitle:title palceholder:placeholder];
    }
    return self;
}

- (void)setupViewWithTitle:(NSString *)title palceholder:(NSString *)placeholder
{
    
    self.backgroundColor = [UIColor whiteColor];
    CGFloat sh = self.bounds.size.height;
    //左边的view
    UIView *leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, sh)];
    //labe
    UILabel *lb = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, 85, sh)];
    lb.numberOfLines = 0; //2019-2-22防止国际化显示不全
    lb.text = title;
    [leftView addSubview:lb];
    self.leftView = leftView;
    self.leftViewMode = UITextFieldViewModeAlways; //总是显示右边的视图 对
    self.clearButtonMode = UITextFieldViewModeAlways; //清除模式
    self.placeholder = placeholder;
}
@end
